// 配置路由，导入react-router-dom        Redirect重定向
import { BrowserRouter as Router, Route, Redirect } from 'react-router-dom'
import './index.css'
// 导入两个组件
import Layout from './pages/Layout'
import Login from './pages/Login'

const App = () => {
  return (
    <Router>
      <div className="app">
        {/* 通过默认路由，到Home页面 */}
        <Route exact path="/" render={() => <Redirect to="/Home" />}></Route>
        <Route path="/Login" component={Login}></Route>
        <Route path="/Home" component={Layout}></Route>
      </div>
    </Router>
  )
}

export default App
